package Tathy;

import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

import GameEngine.GameEngine;
import GameEngine.GameObject2D;

public class FireBlue extends GameObject2D {
	Tathy tathy;
BufferedImage BF;
 boolean M1=false;
int contM;
int magia=0;
	public FireBlue() {
		super("");
		
		try{
			BF = ImageIO.read(getClass().getResource("M1.gif"));
			
		}catch (IOException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void paint(Graphics g) {
		
		if(M1==true){
			contM++;
			if (contM>5&& contM <10){
				magia=1;
			}
			if (contM>10&& contM <15){
				magia=2;
			}
			if (contM>15){
				M1=false;
				magia=0;
				contM=0;
			}
		g.drawImage(BF.getSubimage(BF.getWidth()/3*magia, BF.getHeight()/1*0, 
				BF.getWidth()/3,BF.getHeight()),340+50,230+10,null);// err nessa linhA <ARRUMAR>
		g.drawImage(BF.getSubimage(BF.getWidth()/3*magia, BF.getHeight()/1*0, 
				BF.getWidth()/3,BF.getHeight()),340-54,230+10,null);
		g.drawImage(BF.getSubimage(BF.getWidth()/3*magia, BF.getHeight()/1*0, 
				BF.getWidth()/3,BF.getHeight()),340,230+50,null);
		}
		
	}

	@Override
	public void updateKeyEvent(KeyEvent keyevent) {
		if(GameEngine.umPressed){
			System.out.println("1pressionado");
		M1=true;
	}
	}

	@Override
	public void updateMouseEvent(MouseEvent mouseevent) {
		// TODO Auto-generated method stub
		
	}

}
